package exercise.jslide.jslide.utils;

import java.io.Serializable;
import javafx.scene.text.Font;

//文字字体
public class SerializableFont implements Serializable {
    private String name;//字体名称
    private double size;//字号

    public SerializableFont(Font font) {
        this.name = font.getName();
        this.size = font.getSize();
    }

    public SerializableFont(String name, double size) {
        this.name = name;
        this.size = size;
    }

    public Font getFXFont() {
        return Font.font(name, size);
    }

    public double getSize() {
        return size;
    }

    public String getFamily() {
        return name;
    }
}
